package android.slc.sys.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.slc.appbase.ui.activity.base.AppMvvmBaseToolBarActivity;
import android.slc.appbase.vm.AppBaseViewModel;
import android.slc.extras.user.config.ConstantsUser;
import android.slc.sys.R;
import android.slc.sys.databinding.SysActivitySettingBinding;
import android.slc.widget.SlcClickProxy;

import androidx.annotation.Nullable;

import com.blankj.utilcode.util.FragmentUtils;


/**
 * @author slc
 * @date 2020-09-23 14:48
 */

public class SettingActivity extends AppMvvmBaseToolBarActivity<SysActivitySettingBinding, AppBaseViewModel> {
    public static void show(Context context) {
        Intent intent = new Intent(context, SettingActivity.class);
        context.startActivity(intent);
    }

    @Override
    public Object setContentView() {
        return R.layout.sys_activity_setting;
    }

    @Override
    public void onBindView(@Nullable Bundle savedInstanceState) {
        super.onBindView(savedInstanceState);
        mSlcToolbar.setTitle(R.string.sys_label_setting);

        FragmentUtils.add(getSupportFragmentManager(),  new SettingsFragment(), R.id.container);

        getDataBinding().tvOutLogin.setOnClickListener(new SlcClickProxy(v -> ConstantsUser.outLogin(this)));
    }
}
